package com.java.lang;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class TimeD {

	public static void main(String[] args) {
		short year;
		byte mouth;
		byte day;
		byte hour;
		byte minute;
		byte second;
		short miniSecond;

		Calendar calendar = Calendar.getInstance();
		year = (short) calendar.get(Calendar.YEAR);
		mouth = (byte) (calendar.get(Calendar.MONTH) + 1);
		day = (byte) calendar.get(Calendar.DAY_OF_MONTH);
		hour = (byte) calendar.get(Calendar.HOUR_OF_DAY);
		minute = (byte) calendar.get(Calendar.MINUTE);
		second = (byte) calendar.get(Calendar.SECOND);
		miniSecond = (short) calendar.get(Calendar.MILLISECOND);
		System.out.println(year);
		System.out.println(mouth);
		System.out.println(day);
		System.out.println(hour);
		System.out.println(minute);
		System.out.println(second);
		System.out.println(miniSecond);
		
		String part3Date = new SimpleDateFormat("yyyyMMdd").format(new Date());
		String part4Time = new SimpleDateFormat("HHmmss").format(new Date());
		System.out.println(part3Date);
		System.out.println(part4Time);
		
		
	}
	private static void date(){
		String part3Date = new SimpleDateFormat("yyyyMMdd").format(new Date());
		String part4Time = new SimpleDateFormat("HHmmss").format(new Date());
		System.out.println(part3Date);
		System.out.println(part4Time);
	}
}
